<?php
namespace admin;

use models\BaseDoo;

class User extends Admin{
    public function index(){
       //查询所有的列
       $dataBase = new BaseDoo();
       //获取多条数据
    //    $datas = $dataBase->select('order',
    //    ['id','order_code(code)','client_name'],["id[<]"=>500,'LIMIT'=>20,'client_name[~]'=>'东','ORDER'=>['id'=>'DESC']]);

    //获取单条数据
    // $datas = $dataBase->debug()->get('order',['id','client_name','order_code'],["id"=>20]);

    //获取记录数
    $count = $dataBase->debug()->count('order',['id[<]'=>200]);
        dd($count);

        //获取总数
        // $total = $dataBase->sum('order','money');
        //获取平均数
        // $avg = $dataBase->avg('order','money',['id[>]' => 100]);
        // dd($avg);

        // $min = $dataBase->max('order','money');
        // dd($min);

        //增加数据
        // $insert_data = [
        //     "order_code" => 'D13124648578454545454',
        //     "client_name" => '刘皓门店'
        // ];
        // $insert = $dataBase->insert('order',$insert_data);
        // dd($dataBase->id());

        //更新数据
        // $update_data = [
        //     'order_code' => '1221212121212121',
        //     'client_name' => '和平饭店'
        // ];
        // $update = $dataBase->update('order',$update_data,['id'=>50962]);
        // dd($update);

        //删除数据
    //    $delete =  $dataBase->delete('order',[
    //         'id' => 50962
    //     ]);
    //     dd($delete);
        // $this->assign('datas',$datas);
        // $this->display('user/index');
    }
}